package com.twu.biblioteca;

public class UserInformation {

    private String name;
    private String email;
    private String phoneNumber;

    public UserInformation(String name, String email, String phoneNumber) {
        this.name = name;
        this.email = email;
        this.phoneNumber = phoneNumber;
    }

    public String getName() {
        return name;
    }

    public String getEmail() {
        return email;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    @Override
    public boolean equals(Object objectToCompare) {
        if(!(objectToCompare instanceof UserInformation))
            return false;

        UserInformation userInfoToCompare = (UserInformation) objectToCompare;
        if(name.equals(userInfoToCompare.getName()) && email.equals(userInfoToCompare.getEmail())
                && phoneNumber.equals(userInfoToCompare.getPhoneNumber()))
            return true;

        return false;
    }

}
